#ifndef CARDLISTMODEL_H
#define CARDLISTMODEL_H

#include <QAbstractListModel>

#include <QList>

class CardGraphicsItem;

class CardListModel : public QAbstractListModel
{
    Q_OBJECT
private:
    QList<CardGraphicsItem*> cards;

public slots:
    void moveToBattleField( const QModelIndex & index );

    void displayCard( const QModelIndex & index );

    void shuffle();

public:
    CardListModel(QObject *parent);

    int rowCount(const QModelIndex &parent) const;
    QVariant data(const QModelIndex &index, int role) const;

    void addCard(CardGraphicsItem *card, bool top=false);

    bool empty() const { return cards.isEmpty(); }

    CardGraphicsItem *removeTop();


};

#endif // CARDLISTMODEL_H
